At present, data processing devices such as a computer, a smart mobile phone, a palm computer and a tablet computer are popular increasingly. Operation systems of the data processing devices have different characteristics. For example, a certain operation system may have special restriction on foreground and background operation abilities of an application apparatus running in a data processing device. The application apparatus may be referred to an Application (APP).
An APP runs in the foreground, which means that, in an operation system, the APP runs on a current interface and a user may operate the APP on the current interface. In many operation systems, such as iOS operation system, only one APP is allowed to run in the foreground at the same time.
An APP runs in the background, which means that, if the operation system detects an instruction of returning to a main interface or an instruction of switching to another interface when the APP runs in the foreground, the operation system switches the current interface to a target interface and still keeps the running state of the APP. At this time, a user is unable to see the interface of the APP running in the background. In an example, the instruction of returning to the main interface may be an operation of pressing a “home” key of the operation system of a handheld device.
Some operation systems such as the iOS operation system only allow some types of APPs to run in the background. For example, APPs for playing music, APPs for performing a Location Based Service (LBS) and APPs for performing a conversation in the operation system of mobile phone are allowed to run in the background. When such an APP runs in the background, operations corresponding to the APP should be performed. For example, in the background, the APPs for playing music should continue to play music, the APPs for performing a LBS should continue to perform location processing, and the APPs for performing a conversation should keep the conversation. When other types of APPs run in the foreground, if the operation system detects an instruction of returning to a main interface or an instruction of switching to another interface, the operation system pends the APPs, that is, pauses the running states of the APPs.
For some APPs that are not allowed to run in the background, users hope these APPs to run in the background to implement reminding functions. That is, reminding time may be set by a user or calculated by an APP according to the APP's logic. During a process that the APP runs in the background, the APP may trigger a reminding event when the reminding time is up, for example, play music or display reminding letters.
For example, an APP named “background alarm clock” has been developed. A user hopes the APP named “background alarm clock” to run in the background and play music or alarm at appointed time to implement a reminding function. Since the background running of APPs similar to the APP named “background alarm clock” is restricted in some operation systems such as iOS operation system, a solution is provided for these operation systems to implement the background reminding function of the APPs. The solution is implemented as follows. In the description file of an APP, the APP is marked as an APP type that is allowed to run in the background by the operation system. When the APP runs in the background, operations corresponding to the APP are performed. For example, the APP is marked as a music playing type, that is, the APP is disguised as an APP for playing music. Accordingly, the operation system may determine according to the description file that the type of the APP is the music playing type. When running in the background, the APP needs to play a quiet audio file circularly. In this way, the operation system will allow the APP to run in the background. If the APP stops playing the quiet audio file, the APP may be pended by the operation system. Since the APP named “background alarm clock” is allowed to run in the background, the APP may check whether predefined reminding time is up. When the predefined reminding time is up, an alarm clock event corresponding to the predefined reminding time may be triggered, for example, alarm or music is played, to implement the reminding function.
However, the solution has following disadvantages.
When an APP similar to the APP named “background alarm clock” runs in the background, the APP must perform some operations to make the operation system allow the APP to run in the background. For example, the APP needs to play a quiet audio file continuously, perform location processing continuously, or keep a conversation. However, these operations make battery consumption high, and thus it is possible that the battery of the device is used up before the reminding time is up. In this way, the reminding function of the APP cannot be implemented. For example, the reminding time of an alarm clock is set as 7 a.m. by a user. If the battery level of the device is low, it is possible that the battery of the device is used up before 7 a.m. At this time, the operation system has been automatically powered off, and thus the reminding function of the alarm clock cannot be implemented.